home *** CD-ROM | disk | FTP | other *** search
- Path: news.synapse.net!news-admin
- From: phill@synapse.net (Phil Lachance)
- Newsgroups: comp.lang.c++
- Subject: Re: Arrays in C and c++
- Date: Wed, 10 Apr 1996 05:00:12 GMT
- Organization: Chromatic Consulting
- Distribution: world
- Message-ID: <316b3f0c.33230328@news.synapse.net>
- References: <4kc929$38k@hermes.acs.unt.edu>
- NNTP-Posting-Host: violin-22.synapse.net
- X-Newsreader: Forte Agent .99d/32.182
-
- On 8 Apr 1996 23:55:53 GMT, jnr0001@jove.acs.unt.edu (Joseph Neal
- Rake) wrote:
-
- >Is it possible to do 2 dimensional arrays in C or C++? If so, how?
- >
- You declare 2 or more dimensional arrays like:
- int temp[10][20];
- is a 10 by 20 array of int
-
- you access the elements in the regular way.
-
-
- >This is probably a related question: How does one do an array of strings
- >in C or C++, since 1 string is already an array?
- >
- You declare it more or less the same way:
- char temp[10][20];
- where 10 is the number of strings and 20 is the length of the string.
-
-
- _________________________________
- Phil Lachance <phill@synapse.net>
-